<?php

//服务器和数据库信息
$servername = "localhost";
$username = "root";
$password = "";
$dbName = "myDB";
$tableName = "myguest";


//create connection
$conn = new mysqli($servername, $username, $password, $dbName);

//check connection 
if ($conn->connect_error) {
  die('fail to connect' . $conn->connect_error);
}

$sql = "RENAME TABLE $tableName  TO 'myguests';";
$result = $conn->query($sql);
var_dump($result);
// $result = mysql_query($sql);